package com.flyone.herbal.service.impl;

import com.flyone.herbal.mapper.AdminMapper;
import com.flyone.herbal.model.vo.TotalVO;
import com.flyone.herbal.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class AdminServiceImpl implements AdminService {

    @Resource
    private AdminMapper adminMapper;

    @Override
    public TotalVO getAllNum() {
        long medicines  = adminMapper.getAllMedicines();
        long users  = adminMapper.getAllUsers();
        long posts  = adminMapper.getAllPosts();
        long prescriptions  = adminMapper.getAllPrescriptions();
        TotalVO totalVO = new TotalVO();
        totalVO.setMedicineNum(medicines);
        totalVO.setPrescriptionNum(prescriptions);
        totalVO.setPostNum(posts);
        totalVO.setUserNum(users);
        return totalVO;
    }
}
